#ifndef MYVIDEOPLAYER_H
#define MYVIDEOPLAYER_H

#include <QObject>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QImage>
#include <QResizeEvent>

class VideoPlayer : public QGraphicsView
{
    Q_OBJECT
public:
    explicit VideoPlayer(QWidget *parent = nullptr);
    ~VideoPlayer();


public slots:
    void displayFrame(const QImage &image);

protected:
    void resizeEvent(QResizeEvent *event) override;

private:
    void initScene();
    void updateSceneRect();

    QGraphicsScene *scene;
    QGraphicsPixmapItem *pixmapItem;
    QImage currentImage;

};

#endif // MYVIDEOPLAYER_H
